namespace HD.Model
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;

    public class Posts
    {
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        [Required(ErrorMessageResourceName = "PostTitleRequiredMessage", ErrorMessageResourceType = typeof(Resource))]
        [MaxLength(50, ErrorMessageResourceName = "PostTitleMaxMessage", ErrorMessageResourceType = typeof(Resource))]
        public string Title { get; set; }
        public DateTime CreateDate { get; set; }
        [Required(ErrorMessageResourceName = "PostContentRequiredMessage", ErrorMessageResourceType = typeof(Resource))]
        [MaxLength(200, ErrorMessageResourceName = "PostContentMaxMessage", ErrorMessageResourceType = typeof(Resource))]
        public string Content { get; set; }
        public string Type { get; set; }
        public int EmployeeId { get; set; }
        public int PostsTypeId { get; set; }
        [ForeignKey("EmployeeId")]
        public virtual Employee Employee { get; set; }
        [ForeignKey("PostsTypeId")]
        public virtual PostsType PostsType { get; set; }
        public virtual ICollection<Follow> Follows { get; set; }
    }
}
